def lookRoom(cur, current_room):
        sqlcmd = "SELECT name, desc, northof, southof, eastof, westof FROM rooms WHERE id = "+str(current_room)
        cur.execute(sqlcmd)
        room = cur.fetchall()
        room = room[0]
	print 28*"="
        print room[0]
        print room[1]
        directions = ["North","South","East","West"]
        nowheretogo = True
	print "You can see:"
	printObjects(cur, current_room)	
        print "From here, you can go:"
        for i in range(4):
                if room[i+2] != 0:
                        print directions[i]
                        nowheretogo = False
        if nowheretogo == True:
                print "Nowhere."

def takeItem(cur, item, current_room, inventory):
	#First, we want to check to see if the item is in the room we're currently in. 
	#Then we need to set the item's location to 0, and add it to the user's inventory.
	return inventory

def printObjects (cur, cont):
	sqlcmd = "SELECT name FROM items WHERE location = '%s'" % str(cont)
	cur.execute(sqlcmd)
	items = cur.fetchall()
	if items == []:
		print "Nothing."
		return
	else:
		 for item in items:
			print item[0]

def movePlayer(cur, room, dir):
        if dir == "n":
                dirfield = "northof"
        elif dir == "s":
                dirfield = "southof"
        elif dir == "e":
                dirfield = "eastof"
        elif dir == "w":
                dirfield = "westof"
        else:
                print "Not a valid direction"
                return
        sqlcmd = "SELECT "+dirfield+" FROM rooms WHERE id = "+str(room)
        cur.execute(sqlcmd)
        results = cur.fetchall()
        results = results[0]
        return results[0]
